package ma.cdm.compteRendu.bo;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * ParticipantInterne entity. @author Limouri Anouar
 */
@Entity
@Table(name="participantinterne")

public class ParticipantInterne  implements java.io.Serializable {

	// Fields

     private ParticipantInterneId id;
     private CompteRendu compteRendu;

	// Constructors

    /** default constructor */
    public ParticipantInterne() {
    }

	/** full constructor */
	public ParticipantInterne(ParticipantInterneId id, CompteRendu compterendu) {
		this.id = id;
		this.compteRendu = compterendu;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "idcompterendu", column = @Column(name = "IDCOMPTERENDU", nullable = false)),
			@AttributeOverride(name = "matricule", column = @Column(name = "MATRICULE", nullable = false, length = 20)) })
	public ParticipantInterneId getId() {
		return this.id;
	}

	public void setId(ParticipantInterneId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "IDCOMPTERENDU", nullable = false, insertable = false, updatable = false)
	public CompteRendu getCompteRendu() {
		return this.compteRendu;
	}

	public void setCompteRendu(CompteRendu compterendu) {
		this.compteRendu = compterendu;
	}

}